import { createStore, applyMiddleware } from 'redux'
import rootReducer from './reducers'
import { composeWithDevTools } from 'redux-devtools-extension'
import thunk from 'redux-thunk'

const middlewares = composeWithDevTools(applyMiddleware(thunk))

// 初始化store数据
const initState = {
  login: localStorage.getItem('geek_pc_token') || '',
}

const store = createStore(rootReducer, initState, middlewares)
export default store
